Comments should be sent to AppleLink address OPENTPT or Internet address 'opentpt@applelink.apple.com' Unfortunately, we can not provide general technical support via this AppleLink address. Technical support questions should be directed to AppleLink address DEVSUPPORT or Internet address 'devsupport@applelink.apple.com'.
Overview
This is a development release of Open Transport for AppleTalk and TCP/IP.
This release includes an AppleTalk Phase 2 stack containing PAP, ADSP, ATP, DDP and below. It includes a TCP/IP stack containing TCP, UDP, IP and a DNR. More information on the particular capabilities of these two stacks are contained in documentation specific to AppleTalk or TCP/IP (see below).
What this release contains
This release includes
• an Installer that will install Open Transport 1.0.5b1 and Apple Shared Library Manager 2.0 onto your machine.
• a Developer Files folder that contains:
• An ASLM Developer folder contain tools for developing ASLM shared libraries, as well as debugging versions of the Shared Library Manager itself.
• An Open Tpt Client Developer folder that contains documents, header files, MPW libraries, and sample programs
WARNINGS
See also the ReadMe file that accompanies Open Transport
• Any code developed using the 68K interfaces for Open Transport using the SDK with this release will not be compatibile with the 1.1 release. Do not release any products for 68K Open Transport until this warning goes away.
• If you are installing Open Transport on a PowerPC machine, be sure to reboot your machine prior to installation, and do the installation immediately after the reboot is done. Even better, hold down the shift key during booting to disable all extension, then do the installation. If you do not do this, it is possible that the installer will crash during installation.
• If you have installed the debug version of OpenTransport on a NuBus Power Macintosh, you will ALWAYS get 2 UserBreaks when booting your machine. The first UserBreak will have no text associated with it, while the second will have the text "TLibrary::PrivateLoadSegment- Loading a Segment failed". Please do not report these as bugs.
• Be aware that when flow control occurs, it is possible for your notifier routine to receive the T_GODATA event before the OTSnd or OTSndUData returns the flow error to your main program. You must code for this possibility. It is also possible for other events to occur prior to the function that caused the event returning to the main-line code.
In Notifier:
case T_GODATA:
if (!sending)
GoSendSomeData();
else
goDataFlag = true;
break;
In Main-line code
do
{
goDataFlag = false;
sending = true;
err = OTSnd(ep, myData, myDataSize);
sending = false;
} while ( err == kOTFlowErr && goDataFlag)
Development Information
This developer kit was created using the following environment from E.T.O. #16 and E.T.O. #15:
Create an MPW using E.T.O. #16 and the "PreRelease" MPW Folder.
Create a folder inside "Libraries" called "OldLibraries".
Copy all of the files from E.T.O. #15 "Latest MPW:MPW:Libraries:Libraries:" into this
folder.
Copy the file "Latest MPW:MPW:Libraries:CLibraries:StdCLib.o" into this folder.
The main reason for the "OldLibraries" folder is that we couldn't get SIOW applications to work using the PreRelease environment.
We'll try to address this in a future release.
Linking with Open Transport Libraries:
For 68K Libraries:
You should link with OpenTptUtils.o (for model far) or OpenTptUtils.n.o (for model near) if you are writing code that is only dealing with ports. Linking with this file keeps the whole Open Transport environment from loading.
If you're not sure, try linking with this file. If you get unresolved symbols, then link with OpenTransport.o.
If you are writing an application, also link with OpenTransportApp.o (for model far) or OpenTransportApp.n.o (for model near). If you are writing a stand-alone code resource, CFM fragment, or ASLM shared library, also link with OpenTransportExtn.o (for model far) or OpenTransportExtn.n.o (for model near).
You should link with OpenTransport.o (for model far) or OpenTransport.n.o (for model near) if you are writing code that creates and uses endpoints, mappers or other providers. If you are writing an application, also link with OpenTransportApp.o (for model far) or OpenTransportApp.n.o (for model near). If you are writing a stand-alone code resource, CFM fragment, or ASLM shared library, also link with OpenTransportExtn.o (for model far) or OpenTransportExtn.n.o (for model near).
You should link with OpenTptATalk.o (for model far) or OpenTptATalk.n.o (for model near) if you are writing code that uses the AppleTalkServices provider.
You should link with OpenTptInet.o (for model far) or OpenTptInet.n.o (for model near) if you are writing code that uses the InternetServices provider.
In all cases, if you are NOT writing an appliction, but are writing a stand-alone code resource, CFM fragment, or ASLM shared library, also link with OpenTransportApp.o (for model far) or OpenTransportExtn.n.o (for model near).
If you are writing code that uses ASLM, then you should link with the ASLM libraries first, then the Open Transport libraries, ignoring any duplicate symbol definitions that occur between them.
For PPC Libraries:
You should link with OpenTransportUtilLib and OpenTptUtilsPPC.o if you are writing code that is only dealing with ports.
Linking with this file keeps the whole Open Transport environment from loading. If you're not sure, try linking with this file.
If you get unresolved symbols, then link with OpenTransportLib and OpenTransportPPC.o.
If you are writing an application, also link with OpenTptUtilsAppPPC.o. If you are writing a stand-alone code resource, CFM fragment, or ASLM shared library, link with OpenTptUtilsExtnPPC.o instead of OpenTptUtilsAppPPC.o.
You should link with OpenTransportLib and OpenTransportPPC.o if you are writing code that creates and uses endpoints, mappers, or other providers.
If you are writing an application, also link with OpenTransportAppPPC.o. If you are writing a stand-alone code resource, CFM fragment, or ASLM shared library, link with OpenTransportExtnPPC.o instead of OpenTransportAppPPC.o.
You should link with OpenTptATalkPPC.o and OpenTptAppleTalkLib if you are writing code that uses the AppleTalkServices provider, or AppleTalk utility routines
You should link with OpenTptInetPPC.o and OpenTptInternetLib if you are writing code that uses the InternetServices provider, or TCP/IP utility routines.
If you are writing code that uses ASLM, then you should link with the ASLM libraries first, then the Open Transport libraries, ignoring any duplicate symbol definitions that occur between them.
Known bugs/incompatibilities
• The settings "Load only when needed" have been disabled for this release of Open Transport for AppleTalk, but not for TCP/IP.
• Fixed-node support has been disabled for the first ship of Open Transport. It will reappear in the general 1.1 release of Open Transport
• OTScheduleDeferredTask only runs deferred tasks when the Open Transport environment is about to become quiescent. This causes clients using it not to run very often.
API changes since 1.0.1b1
• OpenTptXTI.h was reworked to properly match Unix headers
Changes since 1.0.1b1
General
• Fixed a problem where, if a client got a T_CONNECT event, and did not call RcvConnect in the notify routine, it was possible to lose the connect and have RcvConnect fail when it was eventually called.
• Fixed a problem where client's could get multiple notifications for the same data-type event (T_DATA, T_REQUEST, T_REPLY).
• Fixed a problem where T_REPLY events were not handled properly under certain stress conditions.
• Added support for AckSends when sending data with OTData structures (fragmented data)
• Add support for OTData structure being passed to the OTSnd() function.
• Fixed several problems where the OTLook() function would return wrong information.
• Fixed a memory leak that occured when InstallNotifier() was called, and a notifier was already installed.
• OTCountDataBytes now only returns data bytes for "data"-type packets. In prior releases, if a connect indication was at the top of the stream, it would return the # of bytes in the connect indication. It will now return a kOTLookErr instead.
• Fixed a problem where HoldMemory was being called event though VM was not present on the machine.
• Fixed a problem where the PowerMgrLib was required to be present for Open Transport to run on PowerPC machines.
• An extension called "Menu Manager Update" will be installed into the extension folders of 6100, 7100, and 8100 Power Macintoshes. This fixes a problem with menu resources becoming inadvertently unlocked at inappropriate times (which result in a machine crash).
• Changed the timing for event delivery, to insure that state changes on an endpoint are not affected incorrectly by incoming events.
• OTAsyncOpenXXXXXXXX will now return a kEFAULTErr if no notifier procedure is passed in.
• OTCancelURequest and OTCancelUReply will now return a kOTNotSupportedErr if the endpoint they are called on is not a connectionless transaction endpoint.
• Fixed a problem in the Snd code where the T_DATA bit could be inappropriately cleared, causing clients who used OTLook() to decide that there was no data, when in fact there was.
• Clear the T_GODATA bit when we return partial data to the client in OTSnd.
• Fixed a memory leak where, if the client did not supply a large enough address buffer in OTRcvUData, we never released the packet buffer.
• Fixed a problem in OTRcvURequest where a critical section was entered, but never left, causing ATP not to work properly.
• Fixed a problem in OTListen, where it was not paying attention to the Async flag.
Backward-compatibility for AppleTalk
• We were erroneously returning an npbNotFound error for NBP lookups which timed out. We now return noErr, with the # of names found field set to 0. This fixes problems with a number of applications.
• Fixed a bug where AppleTalk was always copying the packet an extra time (making a total of 2 copies). Now, only 1 copy of the packet is made.
• Fixed a bug where sockets were not closing if data was available on the endpoint at the time of the close. This typically manifested itself as eventually running out of available sockets.
Backward-compatibility for TCP/IP
• Changed the way Closes were handled so that truncation of data does not occur when sending.
• Reworked the internal synchronization to close down several potential race conditions, and to improve system networking performance.
• MacPing is now working.
• Fixed a problem in Passive Opens, where the open could fail due to a defective option management call to TCP.
• Fixed a problem in the Status call, where a number larger than 32767 could be returned for the number of outstanding bytes. Many apps interpret this as a signed number and do nothing, which hangs the machine. We no longer return a number larger than 32767.
TCP/IP
• Extended the number of retries and timeout period to acoomodate the Windows NT DHCP server behavior.
• We no longer drop BOOTP replies of less than the maximum size - several servers on the market send packets this way.
• We now ignore DHCP-only options when configuring with BOOTP.
AppleTalk
• Default PAP open retries to 0, like the documentation says.
• Took out some severe debugging tests on the internal queues in the non-debug build for ADSP.
• Fixed a problem where retransmit advices were not being sent, causing possible hangs.
Links
•
Other notes about this build.
ASLM 2.0
This build installs ASLM 2.0. If you currently have a debugging version of ASLM installed, installing the non-debug version of Open Transport will replace your debug version of ASLM with the non-debug version..
Macsbug messages
If you install the debug version of OpenTransport, there are many internal debugger breaks. You must have macsbug installed, or else if a debugger break occurs, you'll get the "bomb" box.
The Installer installs various Macsbug templates and DCMD's into your Debugger Prefs file. If you have Macsbug on the target machine, an Easy Install will automatically update the Debugger Prefs file. If you're using a newer Macsbug (6.5) which doesn't come with a Debugger Prefs file, the Installer will create a Debugger Prefs file.
There is mostly a pattern to the debugger messages that appear. Most messages have a leading digit, either '0', '1', or '2'. The meanings are:
0 Fatal error. Dump all the registers and do a stack crawl and include the results in a bug report along with what you were doing at the time. Don't bother trying to continue on in Macsbug. The machine is hosed.
1 General error. These debugger breaks occur for events that should not have happened, but this does not necessarily mean that there is a bug in Open Transport. Sometimes these debugger breaks occur because a client has supplied bogus parameters. Hitting 'g' in macsbug should cause the machine to continue on.
2 Status only. Just hit 'g' in Macsbug. These messages report unusual events.
Documentation
There is a "Document" folder which contains more documentation:
• Open Transport Client Note - A reference document for programmers wishing to write software using the Open Transport APIs.
• Open Tpt AppleTalk Dev Note - Material specific to AppleTalk.
• Open Tpt Serial Dev Note - Material specific to Serial endpoints.
• Open Tpt TCP/IP Dev Note - Material specific to TCP/IP.
All of these are preliminary. All of these will be worked over and turned into Apple DocViewer format documents for the final release of Open Transport 1.1.
The installer
The installer will Easy Install the Apple Shared Library Manager and Open Transport AppleTalk and TCP/IP version 1.0, as well as AppleTalk and MacTCP compatibility..
You can “undo” the AppleTalk compatibility installation by using the Network Software Installer 1.4.2 or later, and custom installing AppleTalk for System 7, Ignore any warnings it might give you about installing over a ‘newer’ AppleTalk.
This release also includes a version of MacTCP 3.0. To remove it, remove the TCP/IP Control Panel and reinstall the MacTCP control panel.
Debugger support
The installer will install Open Transport Debugger preferences into the DebuggerPrefs file in your System Folder, if you have one. These debugger prefs contain the ASLM debugger prefs plus Macsbug templates for virtually all structures used in the API. A Macbug dcmd is installed also that can display strings for error messages. For example, typing “OTErr -3158” will tell you what error number -3158 is.
Sample Code
There is a "Samples" folder which contains sample programs and source files.
All of the samples have makefiles that can be used to build them. All of the makefiles use shell variables that must be set to the full pathname of the folders containing the Apple Shared Library Manager and Open Transport header files and object libraries. If you drag the header files and object files from the developer tools diskette to the normal places in MPW, you’d want to set up the shell variables like this before building.
Set ASLMIncludes “{CIncludes}”
Set OldLibraries "{MPW}Libraries:OldLibraries"
Set OTIncludes “{CIncludes}”
Set OTLibs “{CLibraries}”
Set ASLMLibs “{CLibraries}”
Export ASLMIncludes OTIncludes OTLibs ASLMLibs
After doing this,you can build the sample programs by setting your current MPW directory to be the one containing the samples and using the ‘make’ tool. For example, to build the AppleTalk DDPSample program, run the make tool and execute the output:
Make -f DDPSample.make
OpenTransport header files require the header files that were released on E.T.O. #16 in the "Prerelease MPW" folder.
Earlier Release Notes
API changes since 1.0f1
• OpenTptXTI.h was reworked to properly match Unix headers
Changes since 1.0f1
General
• Fixed an out-of-order / data loss problem when flow control was fixed in 1.0f1. This was actually fixed in 1.0f3 (1.0b5c3)
• Fixed the fChildPorts pointer for all of the port info calls. It was previously pointing to an area on the stack.
• The installer will install a system patch called "Menu Manager Update" into the Extension folder.
Backward-compatibility for AppleTalk
• Do not "fail-over" to LocalTalk if a node could not be acquired. Just leave .MPP closed.
• Don't mark the .MPP driver as busy while we're shutting down so that AppleTalk transition queue clients can still make calls.
• Fixed a problem where NBP lookups were happening 8 times faster than the client requested.
• Allow a 0-length zone name in NBP lookups to work properly.
• Self-sending now works properly for NBP
• For 68K machines, added back in the GrowZone proc while .MPP is loading. On some machines, AppleTalk could not load until the finder came up without this.
Backward-compatibility for TCP/IP
TCP/IP
• No longer call HoldMemory/UnholdMemory for the SLIP/PPP MDevs if VM is not present or not ON. This caused a crash on 68K machines that do not support VM.
• Fixed a hanging problem if MacIP was being used and the bind to DDP failed (this occurs if someone else is defending the IP address that we get back from the server).
• Many bugs were fixed in the SLIP/PPP support.
• The installer will no longer delete and overwrite the TCP/IP Preferences file (see WARNING at the beginning of this document).
AppleTalk
•
Links
• Fixed a hang that occurred when unbinding from SAP 0.
Not in this release
AppleTalk Session Protocol (ASP) is not provided and is not planned for the first release of Open Transport. Use AppleTalk backward compatibility.
API changes since 1.0b3
Changes since 1.0b3
General
• Fixed a problem in OTAccept, where the listening endpoint was not returning to the T_IDLE state after handing off a connection.
• Fixed a problem where closing an endpoint inside of the notification routine could cause a crash.
• Flow control on connection-oriented protocols now work.
• Endpoints in Asynchronous-blocking mode will still flow control. This was necessary because otherwise, there is no mechanism to keep from running out of memory on the current Macintosh OS. Only Synchronous/Blocking endpoints will not flow-control.
• OTCountDataBytes now returns all of the data at the streamhead for connection-oriented stream protocols, and not just the data in the first packet.
• Fixed a problem when using AckSends where it was possible to get ack'd twice for the same data if flow control occurred.
• Fixed a crash when using AckSends where it was possible to crash if flow control occurred.
Backward-compatibility for AppleTalk
• Several ARA fixes were implemented, which caused lost packets and memory leaks when several outstanding DDP writes were active.
• Fixed a problem with the ZIP calls, where they ran out of memory on large internets, causing ARA to report that not all zones were received.
• Chooser aging of NBP names was slowed down to help reduce flicker.
• Several applications had problems with the stack running into the heap on 68K machines. We now swap stacks before entering the streams environment IF we are running at deferred task time.
• DDP Checksums were not being computed correctly for certain data patterns, causing several problems with applications and services which used them. This caused many connection-oriented services to hang.
Backward-compatibility for TCP/IP
• Problems running FirstClass Client using TCP/IP were fixed.
TCP/IP
• MacTCP Preferences are now converted to Open Transport TCP/IP preferences, if they exist.
• Data sent to the TCP protocol are now sent in much larger chunks than previously. This allows TCP to use full-size packets on Ethernet. Previous versions were not using full-size packets.
• The glue for the SLIP and PPP MDevs is now locked down in memory when VM is on.
• Problems using DHCP and BootP were fixed.
• Problems with high packet loss links were addressed. The re-transmit timers should now behave correctly.
AppleTalk
• DDP Checksums were not being computed correctly for certain data patterns, causing several problems with applications and services which used them. This caused many connection-oriented services to hang.
• Binding multiple ADSP endpoints to the same socket, and closing them in a different order than they were created caused strange behavior because the STREAM plumbing was not being updated properly. This has been fixed.
• DDP now Nacks IOCTLs it doesn't recognize so that a DebugStr does not occur in the debug version of Open Transport.
• Adding a multinode to DDP now fails properly if a multinode cannot be acquired.
• DDP will now attempt to add the requested multinode. In prior versions, it ignored the requested address.
Links
• The fSlotID field in the OTPortRecord was not being properly filled out for PCI drivers. This has been corrected.
API changes since 1.0b2
• kWorldPort (one of the OTPortRef bus types) was rename to kGeoPort.
Changes since 1.0b2
General
• Fixed a problem in the Listen code that put a listening endpoint into the incorrect state.
Backward-compatibility for AppleTalk
• Reworked the ZIP handling code so that it handles multiple outstanding zip requests properly.
• Reworked the ZIP handling code so that it no longer can run out of memory
• GetZoneList now returns a noBridgeErr when there is no router. This properly emulates Classic AppleTalk behavior.
• An NBP lookup that fails now returns noErr rather than nbpNotFound. This properly emulates Classic AppleTalk behavor.
• An NBP confirm and an NBP lookup that are outstanding at the same time now are handled properly.
• The retry/interval specified in NBP operations is now honored.
Backward-compatibility for TCP/IP
• MacPing no longer hangs
• Operation with VM On was made more robust.
• TCP/IP now fails gracefully if the AppleTalk link is changed out from under it while using MacIP.
• Modified synchronization somewhat to allow other Open Transport clients to run more often.
• The installer will now convert MacTCP preferences to Open Transport preferences when installing.
TCP/IP
• Change the "found" gateway's DDP Address type from ATP to MacIP when running MacIP with manual configuration.
AppleTalk
• Properly handle NBP names that have ≈, :, or @ characters in them
• Routers going away and coming up are handled more robustly now.
• Fixed a memory leak for AARP packets.
• The MAX_timeout field in mapper operations is now supported.
• Connection handoffs in ADSP now work correclty
Links
• Fixed a memory leak and a memory "trash" in the TPI8022 module when sending "raw" packets
API changes since 1.0b1
• OTPortRecord structure has been changed again. This time, we've left lots of extra space for "new" features later.
• The TLookupRequest and TRegisterRequest had a flag field added to them for future enhancements.
Changes since 1.0b1
General
• Running the internet router has been disabled at startup time. However, if you run the Router Manager application, your machine will crash.
• OTCreateOptionString now works correctly in the non-debug build. A compiler optimization error caused the return value to be unreliable.
• Properly hold down all the necessary libraries when VM is on so that they don't page out
• CancelSynchronousCalls was fixed so that it works as advertised.
• Pseudo-port handling was simplified. Pseudo-ports now just use a device type of kOTPseudoDevice.
• The OTConnect call was incorrectly using -1 as T_INVALID to indicate that no data can be sent with the connect. -1 really means T_INFINITE.
• OTScheduleDeferredTask no longer saves the ASLM client value. If you are an ASLM client, it is up to you to set the current client in your callback routine, if that is necessary.
• New libraries for AppleTalk and TCP/IP for PowerPC are required to link your application (see the ReadMe file for details). By adding these extra libraries, PowerPC clients are now only linked with CFM libraries, and a couple of minimal Open Transport stubs.
• Open Transport no longer does a stack swap. This was causing severe performance problems with AppleShare/FileShare and no longer appears to be needed.
• A new sample, "RegisteredPorts", was added to show how to scan the port registry.
• When unloading a protocol, sometimes the zone was left pointing to the System Zone. It is now restored properly.
• Under certain circumstances, it was possible for a protocol to unload from memory while it was still being used, causing a crash. This has been corrected.
Backward-compatibility for AppleTalk
• Multinode delivery is now working
• An nbpConfirm will now return an nbpNoConfirm error instead of an nbpNotFound error. This allows many applications that use network copy protection to work properly.
• The ZIP stub emulation was fixed to be reentrant. Previously they were not, which caused PowerTalk to have severe problems when searching for PowerShare servers.
• Handling of failures when all nodes are taken no longer crashes the machine
• Fixed several memory leaks that caused poor behavior over time.
• Several VM-related bugs were fixed.
• Fixed a race condition where writes were sometimes perceived by clients to be completed before they were removed from the .MPP queue. This usually caused a hang.
• Fixed a bug in NBP where, if a client asked for more than 1 name, and fewer than the "asked for" names were found, duplicate names were delivered to the client.
Backward-compatibility for TCP/IP
• Support was added for listening on multiple TCPStreams on the same port.
TCP/IP
• TCP/IP no longer hangs if it is loaded at boot time
AppleTalk
• OPT_ENABLEEOM was fixed in PAP to be a 4-byte option per the documentation.
• NBP was not allowing registration of names using the specific zone name properly ("*" worked ok, though).
• If a router comes up, and a router was never seen before, and we have an address that is in the correct cable range, fetch and enable the zone multicast address so that zones become visible.
• As a native client of Open Transport AppleTalk, be prepared to see your own registered names when doing a lookup. While the current version of Open Transport does not answer our own lookups in order to maintain compatibility with "Classic" AppleTalk, Inside AppleTalk clearly states that an NBP implementation should answer its own lookups, and we will be moving in that direction.
Links
• When sending IOCTLs to Ethernet or similar devices, the system no longer hangs
• Several new options and IOCTLs were added to the serial endpoint (see OpenTptSerial.h). Also, the SRL_OPT_BREAK is now a read-only option that returns the current break status, and an IOCTL is use to turn break on and off.
• Several new device types were added for ATM LAN and SNAP emulation.
• When talking to a raw Ethernet or similar device, a memory trash was occuring on incoming packets that were near a power of 2 in size.